<?php

$oReq = &App::getRequest();
$oSrvVideo = &App::getModuleService('Video', 'Video');
$oSrvSec = &App::getModuleService('Account', 'Security');
if (!$oSrvSec->hasStaffPerm('MENU_video'))
{
    App::gotoUrl('admin.main');
}

if ( !$iId = $oReq->get('id') )
{
	exit('Id not defined.');
}

$oDb = &Database::get();

$aItem = $oDb->getRow("SELECT vid_id, vid_url, vid_type, stream_id FROM ". App::getT('videos_pending') ." WHERE vid_id = '". $iId ."'");
$aItem['vid_id'] = 'pending_' . $aItem['vid_id'];
$oTpl = &App::getTemplate();
$oTpl->assign(array
(
	'vidUrl' => $oSrvVideo->displayVideo($aItem),
));
$oTpl->setTemplateFile('video.html');
?>